import request from '@/config/axios'

//  发布活动 VO
export interface PublishActivityVO {
  id: number // 编号
  userId: number // 用户编号，系统用户编号或者企业用户编号
  activityId: number // 用户编号
  userType: boolean // 发布活动用户类型，系统用户，企业
}

//  发布活动 API
export const PublishActivityApi = {
  // 查询 发布活动分页
  getPublishActivityPage: async (params: any) => {
    return await request.get({ url: `/td/publish-activity/page`, params })
  },

  // 查询 发布活动详情
  getPublishActivity: async (id: number) => {
    return await request.get({ url: `/td/publish-activity/get?id=` + id })
  },

  // 新增 发布活动
  createPublishActivity: async (data: PublishActivityVO) => {
    return await request.post({ url: `/td/publish-activity/create`, data })
  },

  // 修改 发布活动
  updatePublishActivity: async (data: PublishActivityVO) => {
    return await request.put({ url: `/td/publish-activity/update`, data })
  },

  // 删除 发布活动
  deletePublishActivity: async (id: number) => {
    return await request.delete({ url: `/td/publish-activity/delete?id=` + id })
  },

  // 导出 发布活动 Excel
  exportPublishActivity: async (params) => {
    return await request.download({ url: `/td/publish-activity/export-excel`, params })
  },
}